'use strict';

angular.module('app')
  .directive('appTab', [function() {
    return {
      restrict: 'A',
      replace: true,
      scope: {
        tabs: '=',
        tabClick: '&'
      },
      templateUrl: 'view/template/tab.html',
      link: function(scope) {
        scope.clickTab = function(tab) {
          scope.selectedId = tab.id;
          scope.tabClick(tab);
        };

      }
    }
  }])
